package com.lh.eemsserver.Controller;

import com.lh.eemsserver.Service.SpecialistService;
import com.lh.eemsserver.po.Procedure;
import com.lh.eemsserver.po.Report;
import com.lh.eemsserver.po.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/Specialist")
public class SpecialistController {

    @Autowired
    private SpecialistService specialistService;

    @RequestMapping("/listAllReport")
    public List<Report> listAllReport() {
        return specialistService.listAllReport();
    }

    @RequestMapping("/getProcedure")
    public List<Procedure> getProcedure(@RequestBody Report report) {
        return specialistService.getProcedure(report);
    }

    @RequestMapping("/renewUpdaterInfo")
    public int renewUpdaterInfo(@RequestBody Report report) {
        return specialistService.renewUpdaterInfo(report);
    }


    @RequestMapping("/getUserName")
    public User getUserName(User user) {
        return specialistService.getUserName(user);
    }

    @RequestMapping("/getReportById")
    public Report getReportById(@RequestBody Report report){
        return specialistService.getReportById(report);
    }
    @RequestMapping("/getProcedureNum")
    public int getProcedureNum(@RequestBody Report report){
        return specialistService.getProcedureNum(report);
    }

    @RequestMapping("/setUpdaterInfo")
    public int setUpdaterInfo(@RequestBody Report report){
        return specialistService.setUpdaterInfo(report);
    }

    @RequestMapping("/renewreportState")
    public int renewreportState(@RequestBody Report report){
        return specialistService.renewreportState(report);
    }
    @RequestMapping("/listAllReportExceptApprovalPending")
    public List<Report> listAllReportExceptApprovalPending(){
        return specialistService.listAllReportExceptApprovalPending();
    }
}
